package com.derbysoft.dswitch.adapter.ihg.common.repository.impl;

import com.derbysoft.dswitch.adapter.ihg.common.domain.ReservationDetail;
import com.derbysoft.dswitch.adapter.ihg.common.domain.ReservationLog;
import com.derbysoft.dswitch.adapter.ihg.common.repository.ReservationLogDetailRepository;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by: jason
 * Date: 2012-06-04
 */
@Service("reservationLogDetailService")
public class ReservationLogDetailRepositoryImpl
        extends CommonService<ReservationDetail> implements ReservationLogDetailRepository {
    @Override
    public List<ReservationDetail> load(ReservationLog reservationLog) {
        DetachedCriteria criteria = DetachedCriteria.forClass(ReservationDetail.class);
        return find(criteria.add(Restrictions.eq("reservationLog", reservationLog)));
    }
}
